package com.tmc.platform.jinri.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tmc.bean.common.CommonResult;
import com.tmc.platform.jinri.JinriPolicyServiceImpl;


@Controller
@RequestMapping("/jinri")
public class JinriController {

	@Autowired
	private JinriPolicyServiceImpl policyServiceImpl;
	
	@RequestMapping(value = "/othersPolicy", method =RequestMethod.POST)
	@ResponseBody
	public String othersPolicy(String Random, String OrderId, String Third){
		String jsonString = policyServiceImpl.getOthersPolicy(Random,OrderId,Third);
		return jsonString;
	}
	
	@RequestMapping(value = "/createOrder", method =RequestMethod.POST)
	@ResponseBody
	public String createOrder(String random, String pnr){
		CommonResult cr = policyServiceImpl.createOrder(random,pnr);
		return cr.toJson();
	}
	
}
